package me.zhengjie.controller.outBound;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.annotation.Log;
import me.zhengjie.service.OutBoundMissionService;
import me.zhengjie.service.dto.OutBoundMissionDto;
import me.zhengjie.service.dto.OutBoundMissionQueryCriteria;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@Slf4j
@Api(tags = "出库任务管理")
@RequestMapping("/api/outBoundMission")
public class OutBoundMissionController {

    private final OutBoundMissionService outBoundMissionService;

    @GetMapping
    @Log("查询出库任务")
    @ApiOperation("查询出库任务")
    @PreAuthorize("@el.check('outBoundMission:list')")
    public ResponseEntity<PageResult<OutBoundMissionDto>> queryOutBoundOrder(OutBoundMissionQueryCriteria criteria, Pageable pageable){
        return new ResponseEntity<>(outBoundMissionService.queryAll(criteria,pageable), HttpStatus.OK);
    }
}
